import express from "express";

// demos
import getApi from "../api/demos/getApi";
import postApi from "../api/demos/postApi";

// gp_101fuseface
import gp_101fuseface_postApi from "../api/gp_101fuseface/gp-101fuseface-postApi";
import gp_101fuseface_postApi_2 from "../api/gp_101fuseface/gp_101fuseface_postApi_2";

// women2020
import women2020_postApi from "../api/women2020/women2020_postApi";

// school_wechat_web
import school_wechat_web_postApi from "../api/school-wechat-web/school_wechat_web_postApi";

// file_export_and_import
import file_export_and_import_postApi from "../api/file-export-and-import/file-export-and-import-postApi";

// cloud-authorization
import cloud_authorization_postApi from "../api/cloud-authorization/cloud_authorization_postApi";
import cloud_authorization_getApi from "../api/cloud-authorization/cloud_authorization_getApi";

// sanning_vue
import sanning_vue_postApi from "../api/sanning_vue/sanning_vue_postApi";
import sanning_vue_getApi from "../api/sanning_vue/sanning_vue_getApi";
import sanning_vue_putApi from "../api/sanning_vue/sanning_vue_putApi";
import sanning_vue_putHashApi from "../api/sanning_vue/sanning_vue_putHashApi";
import sanning_vue_deleteApi from "../api/sanning_vue/sanning_vue_deleteApi";
import sanning_vue_getHashApi from "../api/sanning_vue/sanning_vue_getHashApi";
import sanning_vue_postHashApi from "../api/sanning_vue/sanning_vue_postHashApi";

// Voting_WX_Mini_Program
import Voting_WX_Mini_Program_postApi from "../api/Voting_WX_Mini_Program/postApi";
import Voting_WX_Mini_Program_getApi from "../api/Voting_WX_Mini_Program/getApi";
import Voting_WX_Mini_Program_getApi2 from "../api/Voting_WX_Mini_Program/getApi2";

// quesWx-page
import quesWx_page_getApi from "../api/quesWx-page/getApi";
import quesWx_page_getApi_1 from "../api/quesWx-page/getApi_1";
import quesWx_page_postApi from "../api/quesWx-page/postApi";
import quesWx_page_postApi_1 from "../api/quesWx-page/postApi_1";

// ele-calendar
import ele_calendar_getApi from "../api/ele-calendar/getApi";
import ele_calendar_postApi from "../api/ele-calendar/postApi";
import ele_calendar_deleteApi from "../api/ele-calendar/deleteApi";

const router = express.Router();

// ele-calendar
for (let k in ele_calendar_getApi) {
  router.get(`/ele-calendar/${k}`, function (req, res) {
    res.json(ele_calendar_getApi[k]);
  });
}
for (let k in ele_calendar_postApi) {
  router.post(`/ele-calendar/${k}`, function (req, res) {
    res.json(ele_calendar_postApi[k]);
  });
}
for (let k in ele_calendar_deleteApi) {
  router.delete(`/ele-calendar/${k}`, function (req, res) {
    res.json(ele_calendar_deleteApi[k]);
  });
}

// quesWx-page
for (let k in quesWx_page_getApi) {
  router.get(`/${k}`, function (req, res) {
    res.json(quesWx_page_getApi[k]);
  });
}
for (let k in quesWx_page_getApi_1) {
  router.get(`/${k}/*`, function (req, res) {
    res.json(quesWx_page_getApi_1[k]);
  });
}
for (let k in quesWx_page_postApi) {
  router.post(`/${k}`, function (req, res) {
    res.json(quesWx_page_postApi[k]);
  });
}
for (let k in quesWx_page_postApi_1) {
  router.post(`/${k}/*`, function (req, res) {
    res.json(quesWx_page_postApi_1[k]);
  });
}

// Voting_WX_Mini_Program
for (let k in Voting_WX_Mini_Program_getApi2) {
  router.get(`/vote/api/wx/${k}`, function (req, res) {
    res.json(Voting_WX_Mini_Program_getApi2[k]);
  });
}
for (let k in Voting_WX_Mini_Program_getApi) {
  router.get(`/vote/school/voting/${k}`, function (req, res) {
    res.json(Voting_WX_Mini_Program_getApi[k]);
  });
}
for (let k in Voting_WX_Mini_Program_postApi) {
  router.post(`/vote/school/voting/${k}`, function (req, res) {
    res.json(Voting_WX_Mini_Program_postApi[k]);
  });
}

// sanning_vue
for (let k in sanning_vue_postApi) {
  router.post(`/sanning_vue/${k}`, function (req, res) {
    res.json(sanning_vue_postApi[k]);
  });
}
for (let k in sanning_vue_postHashApi) {
  router.post(`/sanning_vue/${k}/*`, function (req, res) {
    res.json(sanning_vue_postHashApi[k]);
  });
}
for (let k in sanning_vue_putHashApi) {
  router.put(`/sanning_vue/${k}/*`, function (req, res) {
    res.json(sanning_vue_putHashApi[k]);
  });
}
for (let k in sanning_vue_putApi) {
  router.put(`/sanning_vue/${k}`, function (req, res) {
    res.json(sanning_vue_putApi[k]);
  });
}
for (let k in sanning_vue_deleteApi) {
  router.delete(`/sanning_vue/${k}`, function (req, res) {
    res.json(sanning_vue_deleteApi[k]);
  });
}
for (let k in sanning_vue_getApi) {
  router.get(`/sanning_vue/${k}`, function (req, res) {
    res.json(sanning_vue_getApi[k]);
  });
}
for (let k in sanning_vue_getHashApi) {
  router.get(`/sanning_vue/${k}/*`, function (req, res) {
    res.json(sanning_vue_getHashApi[k]);
  });
}

// cloud-authorization
for (let k in cloud_authorization_postApi) {
  router.post(`/cloud-authorization/${k}`, function (req, res) {
    res.json(cloud_authorization_postApi[k]);
  });
}
for (let k in cloud_authorization_getApi) {
  router.get(`/cloud-authorization/${k}`, function (req, res) {
    res.json(cloud_authorization_getApi[k]);
  });
}

// file-export-and-import
for (let k in file_export_and_import_postApi) {
  router.post(`/file-export-and-import/${k}`, function (req, res) {
    res.json(file_export_and_import_postApi[k]);
  });
}

// school-wechat-web
for (let k in school_wechat_web_postApi) {
  router.post(`/school-wechat-web/${k}`, function (req, res) {
    res.json(school_wechat_web_postApi[k]);
  });
}

// gp_101fuseface
for (let k in gp_101fuseface_postApi) {
  router.post(`/gp_101fuseface/${k}`, function (req, res) {
    res.json(gp_101fuseface_postApi[k]);
  });
}
for (let k in gp_101fuseface_postApi_2) {
  router.post(`/gp_101fuseface/${k}`, function (req, res) {
    res.json(gp_101fuseface_postApi_2[k]);
  });
}

// women2020
for (let k in women2020_postApi) {
  router.post(`/women2020/${k}`, function (req, res) {
    res.json(women2020_postApi[k]);
  });
}

// demos
for (let k in getApi) {
  router.get(`/demos/${k}`, function (req, res) {
    res.json(getApi[k]);
  });
}
for (let k in postApi) {
  router.post(`/demos/${k}`, function (req, res) {
    res.json(postApi[k]);
  });
}

export default router;
